package org.example.intelligent_education.controller;

import org.example.intelligent_education.model.CourseInfo;
import org.example.intelligent_education.model.Result;
import org.example.intelligent_education.model.TeacherInfo;
import org.example.intelligent_education.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/teacher")
public class TeacherController {
    @Autowired
    private TeacherService teacherService;
    @RequestMapping("/getInfo")
    public Result getTeacherInfo(String tname) {
        return Result.success(teacherService.getTeacherInfo(tname));
    }

    @RequestMapping("/addCourseSource")
    public Result addCourseSource(int cid,String rname,String url) {
        teacherService.insertCourseSource(cid,rname,url);
        return Result.success("添加成功");
    }



}
